package com.im.entity;


import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.Date;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author xainsir
 * @since 2025-01-30
 */
@Data
@TableName("im_group_member")
@Accessors(chain = true)
public class ImGroupMember implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "主键ID")
    private Long id;

    @TableField("group_id")
    @Schema(description = "群聊ID")
    private Long groupId;

    @TableField("user_id")
    @Schema(description = "用户ID")
    private Long userId;

    @TableField("role")
    @Schema(description = "角色(0:成员, 1:管理员, 2:群主)")
    private Integer role;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "加入时间")
    private LocalDateTime createTime; // 自动填充

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime; // 自动填充
}
